﻿<!-- #include file="../Include/Admin_Onlogin.asp" -->
<%
Dim fieldname, num, dbname, dbtype, isknow
fieldname = Trim(Request("fieldname"))
num = Trim(Request("num"))
dbname = Trim(Request("dbname"))
If dbname = "" Then dbname = 0
dbtype = Trim(Request("dbtype"))
If dbtype = "" Then dbtype = 0
isknow = False
Response.Write "<!DOCTYPE html>" & vbCrLf
Response.Write "<head>" & vbCrLf
Response.Write "<title>字段属性设置</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
Response.Write "<script type='text/javascript'>" & vbCrLf
Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
Response.Write "<script language = 'JavaScript'>" & vbCrlf
Response.Write "function changemode(){" & vbCrlf
Response.Write "    var dbname=document.myform.ftype.value;" & vbCrlf
Response.Write "    if(dbname=='Text'){" & vbCrlf
Response.Write "    input1.style.display='';" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "    input1.style.display='none';" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='Num'){" & vbCrlf
Response.Write "    input2.style.display='';" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "    input2.style.display='none';" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='Time'){" & vbCrlf
Response.Write "    input3.style.display='';" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "    input3.style.display='none';" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='yn'){" & vbCrlf
Response.Write "    input4.style.display='';" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "    input4.style.display='none';" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='GetUrl'|dbname=='GetClass'|dbname=='GetSpecil'|dbname=='GetChannel'){" & vbCrlf
Response.Write "    input5.style.display='';" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "    input5.style.display='none';" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "function changetime(){" & vbCrlf
Response.Write "    var dbname=document.myform.Timetype.value;" & vbCrlf
Response.Write "    if(dbname=='3'){" & vbCrlf
Response.Write "    document.myform.Timemb.value=""2"";" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "        document.myform.Timemb.value=""{year}年{month}月{day}日"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "function ok(){" & vbCrlf
Response.Write "    var dbname=document.myform.ftype.value;" & vbCrlf
Response.Write "    if(dbname=='Text'){" & vbCrlf
Response.Write "        for (var i=0;i<document.myform.CatType.length;i++){" & vbCrlf
Response.Write "            if (document.myform.CatType[i].checked){" & vbCrlf
Response.Write "                var cattype=document.myform.CatType[i].value;" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + document.myform.CatNum.value + "","" + document.myform.OutType2.value + "","" + cattype + "")}"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='Num'){" & vbCrlf
Response.Write "        for (var i=0;i<document.myform.OutType.length;i++){" & vbCrlf
Response.Write "            if (document.myform.OutType[i].checked){" & vbCrlf
Response.Write "                var cattype=document.myform.OutType[i].value;" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "    if (cattype=='2'){" & vbCrlf
Response.Write "            dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + cattype + "")}"";" & vbCrlf
Response.Write "    }else{" & vbCrlf
Response.Write "            if (cattype=='0'){" & vbCrlf
Response.Write "                dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + cattype + "","" + document.myform.ZhengShu.value + "")}"";" & vbCrlf
Response.Write "            }else{" & vbCrlf
Response.Write "                dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + cattype + "","" + document.myform.XiaoShu.value + "")}"";" & vbCrlf
Response.Write "            }" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='Time'){" & vbCrlf
Response.Write "    dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + document.myform.Timetype.value + "","" + document.myform.Timemb.value + "")}"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='yn'){" & vbCrlf
Response.Write "    dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + document.myform.yny.value + "","" + document.myform.ynn.value + "")}"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='GetUrl'){" & vbCrlf
Response.Write "        for (var i=0;i<document.myform.outype.length;i++){" & vbCrlf
Response.Write "            if (document.myform.outype[i].checked){" & vbCrlf
Response.Write "                var outype=document.myform.outype[i].value;" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + document.myform.dbtype.value + "","" + outype + "")}"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    if(dbname=='GetClass'|dbname=='GetSpecil'|dbname=='GetChannel'){" & vbCrlf
Response.Write "        for (var i=0;i<document.myform.outype.length;i++){" & vbCrlf
Response.Write "            if (document.myform.outype[i].checked){" & vbCrlf
Response.Write "                var outype=document.myform.outype[i].value;" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        }" & vbCrlf
Response.Write "        dbname=""{$Field("" + document.myform.Fieldnum.value + "","" + dbname + "","" + outype + "")}"";" & vbCrlf
Response.Write "    }" & vbCrlf
Response.Write "    document.getElementById('SkinCode').value=dbname;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</head>" & vbCrlf
Response.Write "<body>" & vbCrlf
Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrLf
Response.Write "<div class=""table-responsive"">" & vbCrLf
Response.Write "<form action="""" method=""post"" name=""myform"" id=""myform"">" & vbCrlf
Response.Write "<input name='Fieldnum' id='Fieldnum' value=""" & num & """ type='hidden'>" & vbCrlf
Response.Write "<input type='hidden' name='SkinCode' size='50' id='SkinCode'>" & vbCrlf
Response.Write "<table class='layui-table table-hover'>" & vbCrlf
Response.Write "    <tr><td><strong>字段名称：</strong><input name='FieldName' type='text' id='FieldName' size='35' value=""" & fieldname & """ readonly=""readonly""></td></tr>" & vbCrlf
Response.Write "    <tr><td><strong>输出类型：</strong><select id=""ftype"" name=""ftype"" onchange=""changemode()""><option value='Text'>文本型</option>" & vbCrlf
If (dbtype > 1 And dbtype < 7) Or dbtype = 131 Then
	Response.Write "<option value='Num' selected>数字型</option>"
	isknow = True
Else
	Response.Write "<option value='Num'>数字型</option>"
End If
If dbtype = 7 Then
	Response.Write "<option value='Time' selected>时间型</option>"
	isknow = True
Else
	Response.Write "<option value='Time'>时间型</option>"
End If
If dbtype = 11 Then
	Response.Write "<option value='yn' selected>是否型</option>"
	isknow = True
Else
	Response.Write "<option value='yn'>是否型</option>"
End If

If LCase(fieldname) = "id" Then
	Response.Write "<option value='GetUrl' selected>对象路径(系统内置)</option>"
	isknow = True
Else
	Response.Write "<option value='GetUrl'>对象路径(系统内置)</option>"
End If

If LCase(fieldname) = "classid" Then
	Response.Write "<option value='GetClass' selected>栏目路径(系统内置)</option>"
	isknow = True
Else
	Response.Write "<option value='GetClass'>栏目路径(系统内置)</option>"
End If

If LCase(fieldname) = "channelid" Then
	Response.Write "<option value='GetChannel' selected>模型路径(系统内置)</option>"
	isknow = True
Else
	Response.Write "<option value='GetChannel'>模型路径(系统内置)</option>"
End If
Response.Write "</select></td></tr>" & vbCrlf
If isknow = False Then
	Response.Write "<tbody id='input1' style='display:'>"
Else
	Response.Write "<tbody id='input1' style='display:none'>"
End If
Response.Write "    <tr><td><strong>输出长度：</strong><input id='CatNum' name='CatNum' type='text' id='gotopic' size='20' value=0>&nbsp;&nbsp;&nbsp;<font color='#FF0000'>为0则不截断</font></td></tr>" & vbCrlf
Response.Write "    <tr><td><strong>过滤处理：</strong><select id='OutType2' name='OutType2'><option value='0' selected>解析HTML标记</option><option value='1'>不解析HTML标记</option><option value='2'>过滤HTML标记</option></select></td></tr>" & vbCrlf
Response.Write "    <tr><td><strong>截断处理：</strong><Input type='radio' id='CatType' name='CatType' value='0' checked>显示...&nbsp;&nbsp;<Input type='radio' id='CatType' name='CatType' value='1'>不显示...</td></tr>" & vbCrlf
Response.Write "</tbody>" & vbCrlf
Response.Write vbCrlf
If ((dbtype > 1 And dbtype < 7) Or dbtype = 131) And Not (LCase(fieldname) = "id" Or LCase(fieldname) = "classid" Or LCase(fieldname) = "channelid") Then
	Response.Write "<tbody id='input2' style='display:'>"
Else
	Response.Write "<tbody id='input2' style='display:none'>"
End If
Response.Write "    <tr><td><strong>输出方式：</strong><Input type='radio' id='OutType' name='OutType' value='0' checked onClick=""input21.style.display='';input22.style.display='none'"">整数 <Input type='radio' id='OutType' name='OutType' value='1' onClick=""input21.style.display='none';input22.style.display=''"">小数 <Input type='radio' id='OutType' name='OutType' value='2' onClick=""input21.style.display='none';input22.style.display='none'"">百分数</td></tr>" & vbCrlf
Response.Write vbCrlf
If ((dbtype > 1 And dbtype < 7) Or dbtype = 131) And Not (LCase(fieldname) = "id" Or LCase(fieldname) = "classid" Or LCase(fieldname) = "channelid") Then
	Response.Write "<tbody id='input21' style='display:'>"
Else
	Response.Write "<tbody id='input21' style='display:none'>"
End If
Response.Write "        <tr><td><strong>输出方式：</strong><input name='ZhengShu' type='text' id='ZhengShu' size='10' value='0'>&nbsp;&nbsp;<font color='#FF0000'>根据数值输出符号,为0则输出原数</font></td></tr></tbody>" & vbCrlf
Response.Write "    <tbody id='input22' style='display:none'><tr><td><strong>小数位数：</strong><input name='XiaoShu' type='text' id='XiaoShu' size='4' value=2></td></tr></tbody>" & vbCrlf
Response.Write "</tbody>" & vbCrlf
Response.Write vbCrlf
If dbtype = 7 Or dbtype = 135 Then
	Response.Write "<tbody id='input3' style='display:'>"
Else
	Response.Write "<tbody id='input3' style='display:none'>"
End If
Response.Write "    <tr><td><strong>输出格式：</strong><select id=""Timetype"" name=""Timetype"" onchange=""changetime()""><option value='0' selected>模板输出</option><option value='1'>模板输出(补零)</option><option value='2'>模板输出(限位补零)</option><option value='3'>函数处理</option></select></td></tr>" & vbCrlf
Response.Write "    <tr><td><strong>输出摸板：</strong><input name='Timemb' type='text' id='Timemb' size='35' value=""{year}年{month}月{day}日""></td></tr>" & vbCrlf
Response.Write "</tbody>" & vbCrlf
Response.Write vbCrlf
If dbtype = 11 Then
	Response.Write "<tbody id='input4' style='display:'>"
Else
	Response.Write "<tbody id='input4' style='display:none'>"
End If
Response.Write "    <tr><td><strong>为真输出：</strong><input name='yny' type='text' id='yny' size='20' value=""是""></td></tr>" & vbCrlf
Response.Write "    <tr><td><strong>为假输出：</strong><input name='ynn' type='text' id='ynn' size='20' value=""否""></td></tr>" & vbCrlf
Response.Write "</tbody>" & vbCrlf
If LCase(fieldname) = "id" Or LCase(fieldname) = "classid" Or LCase(fieldname) = "channelid" Then
	Response.Write "<tbody id='input5' style='display:'>"
Else
	Response.Write "<tbody id='input5' style='display:none'>"
End If

If LCase(fieldname) = "id" Then
	Response.Write "    <tr class=""tdbg""><td><strong>数据类别：</strong><select id='dbtype' name='dbtype'>" & vbCrlf
	Call Exec(Rs,"Select ChannelID,ChannelName from Channel where ChannelType<=1 And ChannelHidden=" & WK_False & " Order By ChannelOrder Asc,ChannelID Desc",2)
	Do While Not Rs.EOF
	Response.Write "<option value='" & Rs("ChannelID") & "'>" & Rs("ChannelName") & "</option>" & vbCrlf
	Rs.movenext
	Loop
	Set Rs = Nothing
	Response.Write "</select></td></tr>" & vbCrlf
End If

Response.Write "<tr><td><strong>输出方式：</strong>" & vbCrlf
if instr(lcase(fieldname),"channelid") = 0 Then
	Response.Write "    <Input type='radio' id='outype' name='outype' value=3 checked>混合 <Input type='radio' id='outype' name='outype' value='1'>路径 <Input type='radio' id='outype' name='outype' value='2'>名称" & vbCrlf
else
	Response.Write "    <Input type='radio' id='outype' name='outype' value=1 checked>目录 <Input type='radio' id='outype' name='outype' value='2'>名称 <Input type='radio' id='outype' name='outype' value='3'>上传目录" & vbCrlf
end if
Response.Write "</td></tr>" & vbCrlf
Response.Write "</tbody>" & vbCrlf
Response.Write "</table>" & vbCrlf
Response.Write "</form>" & vbCrlf
Response.Write "</div>" & vbCrLf
Response.Write "</div>" & vbCrLf
Response.Write "</body>" & vbCrlf
Response.Write "</html>" & vbCrlf
Response.Write vbCrlf
%>